<template>
    <div>
        <Header />
        <el-container class="container">
            <el-main class="main">
                <div class="main-container">
                    <div class="main-left">
                        <div class="main-title">{{ siteConfig.siteName }}</div>
                        <div class="main-content">
                            {{ $t('index.Steve Jobs') }}
                        </div>
                        <el-button
                            v-if="memberCenter.state.open"
                            @click="$router.push(memberCenterBaseRoutePath)"
                            class="container-button"
                            size="large"
                        >
                            {{ $t('Member Center') }}
                        </el-button>
                    </div>
                    <div class="main-right">
                        <img :src="indexCover" alt="" class="cover-image" />
                    </div>
                </div>
            </el-main>
        </el-container>
        <Footer />
    </div>
</template>

<script setup lang="ts">
import indexCover from '/@/assets/index/index-cover.svg'
import { useSiteConfig } from '/@/stores/siteConfig'
import { useMemberCenter } from '/@/stores/memberCenter'
import Header from '/@/layouts/frontend/components/header.vue'
import Footer from '/@/layouts/frontend/components/footer.vue'
import { memberCenterBaseRoutePath } from '/@/router/static/memberCenterBase'

const siteConfig = useSiteConfig()
const memberCenter = useMemberCenter()
</script>

<style scoped lang="scss">
.container-button {
    margin: 0 15px 15px 0;
    background: linear-gradient(135deg, #42b983, #33a06f);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 185, 131, 0.4);

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(66, 185, 131, 0.6);
    }
}

.container {
    width: 100vw;
    height: 100vh;
    background: url(/@/assets/bg.jpg) repeat;
    color: var(--el-color-white);
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at 30% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
        z-index: 1;
    }

    .main {
        height: calc(100vh - 120px);
        padding: 0;
        position: relative;
        z-index: 2;

        .main-container {
            display: flex;
            height: 100%;
            width: 75%;
            max-width: 1400px;
            margin: 0 auto;
            align-items: center;
            justify-content: space-between;

            .main-left {
                padding-right: 50px;
                animation: fadeInLeft 1s ease-out;

                .main-title {
                    font-size: 52px;
                    font-weight: 700;
                    margin-bottom: 10px;
                    background: linear-gradient(135deg, #ffffff, #e6e6e6);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
                    letter-spacing: 1px;
                }

                .main-content {
                    padding-top: 20px;
                    padding-bottom: 40px;
                    font-size: calc(var(--el-font-size-large) + 2px);
                    line-height: 1.6;
                    opacity: 0.9;
                    max-width: 600px;
                    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
                }
            }

            .main-right {
                animation: fadeInRight 1s ease-out;

                .cover-image {
                    width: 420px;
                    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
                    transition: transform 0.5s ease;

                    &:hover {
                        transform: translateY(-10px) scale(1.02);
                    }
                }
            }
        }
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.header {
    background-color: transparent !important;
    box-shadow: none !important;
    position: fixed;
    width: 100%;
    z-index: 10;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;

    &:hover {
        background-color: rgba(0, 0, 0, 0.2) !important;
    }

    :deep(.header-logo) {
        span {
            padding-left: 4px;
            color: var(--el-color-white);
            font-weight: 600;
        }
    }

    :deep(.frontend-header-menu) {
        background: transparent;
        .el-menu-item,
        .el-sub-menu .el-sub-menu__title {
            color: var(--el-color-white);
            font-weight: 500;
            transition: all 0.3s ease;

            &.is-active {
                color: var(--el-color-white) !important;
                transform: translateY(-2px);
            }

            &:hover {
                background-color: transparent !important;
                color: var(--el-menu-hover-text-color);
                transform: translateY(-2px);
            }
        }
    }
}

.footer {
    color: var(--el-text-color-secondary);
    background-color: transparent !important;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    font-size: 14px;
    backdrop-filter: blur(5px);
    z-index: 5;
}

@media screen and (max-width: 1200px) {
    .container .main .main-container {
        width: 85% !important;
    }
}

@media screen and (max-width: 1024px) {
    .container {
        .main {
            height: unset;
            padding-top: 100px;
            padding-bottom: 80px;
        }
    }
    .main-container {
        width: 90% !important;
        flex-wrap: wrap;
        align-content: center;
        justify-content: center !important;

        .main-left {
            text-align: center;
            padding-right: 0;

            .main-title {
                font-size: 42px !important;
            }

            .main-content {
                margin: 0 auto;
            }

            .container-button {
                margin: 0 auto 30px;
            }
        }

        .main-right {
            padding-top: 50px;
        }
    }
}

@media screen and (max-width: 768px) {
    .main-left .main-title {
        font-size: 36px !important;
    }

    .main-right .cover-image {
        width: 350px !important;
    }
}

@media screen and (max-width: 375px) {
    .main-right img {
        width: 300px !important;
    }
}

@media screen and (max-height: 650px) {
    .main-right img {
        display: none;
    }
}

@at-root html.dark {
    .container {
        background: url(/@/assets/bg-dark.jpg) repeat;

        &::before {
            background: radial-gradient(circle at 30% 50%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7));
        }
    }

    .container-button {
        background: linear-gradient(135deg, #3a9d70, #2a7d5f);
        box-shadow: 0 4px 15px rgba(58, 157, 112, 0.3);
    }
}
</style>
